import * as tt2 from "../../../ttapi_layer2/ttlayer2.js";

import { IEditorUI, IFileEditor } from "../editorbase.js";
//import { Image_EditorUI } from "./editor.js";
import * as EUI from "../../eui/EUI.js"

export class Atals_Editor implements IFileEditor {
    getName(): string {
        return "Atlas";
    }
    getCareExts(): string[] {
        return [".atlas.json"];
    }
    newEditorUI(): IEditorUI {
        //return new Image_EditorUI();
        return null;
    }
    supportNewFile(): boolean {
        return true;
    }
    async newFileAsync(filename: string, win: EUI.EUI_Window): Promise<boolean> {

        let tmpjson = {
            src: "./*.png",
            tex: "",
            texsize: "1024,1024",
            sprites: [{ name: "all", uv: "0,0,1024,1024", border: "0,0,0,0" }]
        };
        await tt2.QExt_IO.File_Write(filename, JSON.stringify(tmpjson, null, 4));
        return true;
    }
}